#pragma once

#include <string.h>

#include <fcntl.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <signal.h>
#include <vector>

#include "CCClientProcess.h"

#define LISTEN_PORT 8080

class CCStreamServer
{
public:
    CCStreamServer();
    ~CCStreamServer();

    void startTCPServer();
private:
    void closeListenSockFd();
    static void serverExitSignalProcess(int num);

private:
    int m_listenSockFd{-1};
    static bool m_bServerRunning;
    std::vector<CCClientProcess *> m_clients;
};